<?php
/**
 * Created by gjk7788@163.com.
 * User: Carl
 * Date: 2018/6/22
 * Time: 13:04
 */

namespace App\Rules;

use App\Inspections\Spam;
use Mockery\Exception;

class SpamFree
{
    public function passes($attribute, $value)
    {
        try {
            return ! resolve(Spam::class)->detect($value);
        } catch (Exception $e) {
            return false;
        }
    }
}